package beans;

import java.util.List;

import dao.Course;
import dao.CourseDAO;

public class Coursebean {

    private CourseDAO courseDAO;
    public Coursebean(){
	courseDAO = new CourseDAO();
    }
    public List<Course> getCourseByGrade(String grade){
	return courseDAO.findByGrade(grade);
    }
    public boolean addCourse(Course course){
	return courseDAO.save(course);
    }
    
    public boolean modifyCourse(Course course){
	return courseDAO.update(course);
    }
    
    public Course getCourseByid(String id){
	return courseDAO.findById(id);
    }
    
    public Course getCourseByTeacherid(String teacherid){
	return courseDAO.findByTeacherid(teacherid);
    }
    public int getCourseCounts(){
	int counts = 0;
	return counts;
    }
}
